<script setup>
import { ref } from 'vue';

// import child from './child.vue';
import Child from './child.vue';

const comp = ref(null);
const handleColor = () => {
  console.log(comp.value.getData(), 'comp.value');
  comp.value.changeColor();
};

</script>
<script>
// import { child as Child } from './child.vue';

</script>
<template>
  <p>Expose</p>
  <button @click="handleColor">
    更改子组件的Color方法
  </button>
  <div>
    <!-- <child ref="comp" /> -->
    <Child ref="comp" />
  </div>
</template>
